<?php
    class Default_Model_Category extends Zend_Db_Table_Abstract
    {
        protected $_name = 'category';
        protected $_primary = 'cat_id';
        protected $_db;
        
        public function __construct() {
            $this->_db = Zend_Registry::get('db');
        }
        
        public function listCategory() {
            $sql = $this->_db->select()
                            ->from($this->_name)
                            ->where('status = 1')
                            ->order('cat_id DESC');
            $result = $this->_db->fetchAll($sql);
            return $result;
        }
    }
